<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 20px; }
        table { border-collapse: collapse; margin: 20px 0; }
        td { padding: 8px; }
        input[type="text"], input[type="password"] { width: 200px; }
        input[type="submit"] { padding: 5px 15px; background: #4CAF50; color: white; border: none; cursor: pointer; }
        .error { color: red; margin-top: 10px; }
    </style>
</head>
<body>
<h2>用户登录</h2>

<!-- 修正1：表单标签未闭合，且内容应在表单内部 -->
<form action="/login" method="post">
    <table>
        <tr>
            <td>用户名: </td>
            <td>
                <!-- 修正2：密码字段应为 type="password" -->
                <input type="text" name="username" required />
            </td>
        </tr>
        <tr>
            <td>密码: </td>
            <td>
                <input type="password" name="password" required />
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center;">
                <input type="submit" value="登录" />
            </td>
        </tr>
    </table>

    <!-- 修正3：显示Shiro返回的错误信息 -->
    <div th:if="${error}" class="error" th:text="${error}"></div>
</form>
</body>
</html>